import request from '@/utils/request'

// 查询维护备件消耗记录（跟踪维护任务中的物料使用情况）列表
export function listConsumption(query) {
  return request({
    url: '/equipment-service/equipment/consumption/list',
    method: 'get',
    params: query
  })
}

// 查询维护备件消耗记录（跟踪维护任务中的物料使用情况）详细
export function getConsumption(consumptionId) {
  return request({
    url: '/equipment-service/equipment/consumption/' + consumptionId,
    method: 'get'
  })
}

// 新增维护备件消耗记录（跟踪维护任务中的物料使用情况）
export function addConsumption(data) {
  return request({
    url: '/equipment-service/equipment/consumption',
    method: 'post',
    data: data
  })
}

// 修改维护备件消耗记录（跟踪维护任务中的物料使用情况）
export function updateConsumption(data) {
  return request({
    url: '/equipment-service/equipment/consumption',
    method: 'put',
    data: data
  })
}

// 删除维护备件消耗记录（跟踪维护任务中的物料使用情况）
export function delConsumption(consumptionId) {
  return request({
    url: '/equipment-service/equipment/consumption/' + consumptionId,
    method: 'delete'
  })
}

// 更新库存批次数量
export function updateBatchQuantity(data) {
  return request({
    url: '/equipment-service/equipment/inventory/batchesDtos',
    method: 'put',
    data: data
  })
}